const express = require('express');
const router = express.Router();



//判断用户是否登录，不登录路由截至
router.use('/',(req,res,next) => {
    if(req.session.userInfo){
        next()
    }else{
        return res.send({
            code: 3,
            msg: '请登录'
        })
    }
})

//加载用户信息
router.use('/load',require('./controllers/load/loadUserInfo'))

//修改密码
router.use('/password',require('./controllers/update/updatePassword'))

//修改手机号
router.use('/phone',require('./controllers/update/updatePhone'))


module.exports = router
